package com.pmenergy.model;

// Generated 15/08/2014 01:13:30 AM by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * ItemPeriodoAlquiler generated by hbm2java
 */
@Entity
@Table(name = "ITEM_PERIODO_ALQUILER", schema = "TECNOTREE")
public class ItemPeriodoAlquiler implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private ItemPeriodoAlquilerId id;
	private PeriodoAlquiler periodoAlquiler;
	private Item item;
	private BigDecimal costoAlquiler;

	public ItemPeriodoAlquiler() {
	}

	public ItemPeriodoAlquiler(ItemPeriodoAlquilerId id,
			PeriodoAlquiler periodoAlquiler, Item item, BigDecimal costoAlquiler) {
		this.id = id;
		this.periodoAlquiler = periodoAlquiler;
		this.item = item;
		this.costoAlquiler = costoAlquiler;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "itemId", column = @Column(name = "ITEM_ID", nullable = false, precision = 22, scale = 0)),
			@AttributeOverride(name = "periodoAlquilerId", column = @Column(name = "PERIODO_ALQUILER_ID", nullable = false, precision = 22, scale = 0)) })
	public ItemPeriodoAlquilerId getId() {
		return this.id;
	}

	public void setId(ItemPeriodoAlquilerId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PERIODO_ALQUILER_ID", nullable = false, insertable = false, updatable = false)
	public PeriodoAlquiler getPeriodoAlquiler() {
		return this.periodoAlquiler;
	}

	public void setPeriodoAlquiler(PeriodoAlquiler periodoAlquiler) {
		this.periodoAlquiler = periodoAlquiler;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ITEM_ID", nullable = false, insertable = false, updatable = false)
	public Item getItem() {
		return this.item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	@Column(name = "COSTO_ALQUILER", nullable = false, precision = 5, scale = 5)
	public BigDecimal getCostoAlquiler() {
		return this.costoAlquiler;
	}

	public void setCostoAlquiler(BigDecimal costoAlquiler) {
		this.costoAlquiler = costoAlquiler;
	}

}
